import request from '@/api/request.js'


export default {
  // 用户list
  userList(form){
    return request({
      url:'/user/query/'+form.currentPage+'/'+form.pageSize,
      method:'post',
      data:{
      }
    })
  },

  // 用户登陆
  userLogins(form){
    return request({
      url:'/user/login',
      method:'post',
      data:{
        userName:form.userName,
        userPass:form.userPass,
        // form
      }
    })
  },

  // 新增用户
  userInsert(form){
    return request({
      url:'/user/insert',
      method:'post',
      data:{
        nickName:form.nickName,
        remark:form.remark,
        userName:form.userName,
        userPass:form.userPass,
        userRole:form.userRole
      }
    })
  },

  // 删除用户
  userDelete(userId){
    return request({
      url:'/user/delete',
      method:'post',
      data:{
        userId
      }
    })
  },

  // 用户更新状态
  userUpdateStatus(status,userId){
    return request({
      url:'/user/update',
      method:'post',
      data:{
        status,
        userId
      }
    })
  },

  // 用户更新密码
  userUpdatePwd(form){
    return request({
      url:'/user/update',
      method:'post',
      data:{
        userId:form.userId,
        userPass:form.userPass
      }
    })
  },

  // 用户编辑（所有）
  userUpdateAll(form){
    return request({
      url:'/user/update',
      method:'post',
      data:{
        userId:form.userId,
        nickName:form.nickName,
        userRole:form.userRole,
        remark:form.remark,
        userName:form.userName
      }
    })
  },
}
